package com.dd.common.dto.system.user;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Email;
import javax.validation.constraints.Pattern;


@Schema(description = "当前管理员个人信息更新DTO")
@Data
public class SysUserSelfUpdateDTO implements java.io.Serializable {
    @Schema(description = "账号用户名（仅限字母、数字、下划线）", example = "admin_user_1")
    @Pattern(regexp = "^[a-zA-Z0-9_]{4,30}$", message = "用户名必须由4-30位字母、数字或下划线组成")
    private String username;

    @Email(message = "邮箱格式不正确")
    @Schema(description = "邮箱地址", example = "user@example.com")
    private String email;

    @Pattern(regexp = "^\\+?[0-9]{10,15}$", message = "手机号格式不正确，支持国际格式")
    @Schema(description = "手机号码（可选，支持国际号码）", example = "+8613812345678")
    private String phone;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "昵称", example = "如烟大帝")
    private String nickname;
    @Schema(description = "真实姓名", example = "柳如烟")
    private String realName;
    @Schema(description = "性别（0-未知，1-男，2-女）", example = "1")
    @Range(min = 0, max = 2, message = "性别只能是0、1或2")
    private Integer gender;
}
